﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Scheduler.Presentation_Layer
{
    /**Class: Employee_Main
     * @author Sara Tuohy
     * @version 1.0
     * Course : ITEC 4860 Spring 2012
     * Written: March, 2012
     * This form presents the Employee Appropriate Options
     * Moved the panel allocations from the constructor to the
     * Button_Click actions for efficiency.
     */
    public partial class Employee_Main : Form
    {

        /**
         * EmployeePreferences panel to serve user request           */
        private EmployeePreferences empPreferencesPanel;
        /**
         * EmployeeProfile panel to serve user request              */
        private EmployeeProfile empProfilePanel;
        /**
         * EmployeeListing panel to serve user request              */
        private EmployeeListing empListPanel;
        /**
         * WeekDisplay panel to serve user request                  */
        private WeekDisplayer weekDisplayPanel;
        /**
         * Driver panel to end program gracefully                   */
        private Driver driverPanel;


        /**Method: Employee_Main
         * Constructor
         * @param Driver allows return to caller
         */
        public Employee_Main(Driver dp)
        {
            InitializeComponent();
            driverPanel = dp;
            driverPanel.Hide();
        }

        /**Method: emEmployeeProfileButton_Click
         * Presents the employee profile panel
         * Purpose: display empProfilePanel
         */
        private void emEmployeeProfileButton_Click(object sender, EventArgs e)
        {
            empProfilePanel = new EmployeeProfile();
            empProfilePanel.ShowDialog();
        }

        /**Method: emEmployeePreferencesButton_Click
         * Presents the employee preferences panel
         * Purpose: display empPreferencesPanel
         */
        private void emEmployeePreferencesButton_Click(object sender, EventArgs e)
        {
            empPreferencesPanel = new EmployeePreferences();
            empPreferencesPanel.ShowDialog();
        }

        /**Method: OnFormClosing
         * Displays the calling panel
         * Purpose: return to calling panel
         */
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            driverPanel.Show();
        }

        /**Method: emEmployeeListButton_Click
         * Presents the employee list panel
         * Purpose: display empListPanel
         */
        private void emEmployeeListButton_Click(object sender, EventArgs e)
        {
            empListPanel = new EmployeeListing();
            empListPanel.ShowDialog();
        }

        /**Method: emViewPrevSchedsButton_Click
         * Presents the panel for previous schedules
         * Purpose: display previous schedules
         */
        private void emViewPrevSchedsButton_Click(object sender, EventArgs e)
        {
            weekDisplayPanel = new WeekDisplayer();
            weekDisplayPanel.ShowDialog();
        }
    }
}
